﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using LogScrubberCommon;
using System.Configuration;

namespace LogScrubberAdmin
{
  public partial class LogScrubberForm : Form
  {
      LogScrubberConfiguration config = null;


    public LogScrubberForm()
    {
      InitializeComponent();
    }

    private void LogScrubberForm_Load(object sender, EventArgs e)
    {
        string applicationName = "LogScrubberService.exe";


        
        // Get the application path.
        string exePath = System.IO.Path.Combine(
            Environment.CurrentDirectory, applicationName);


        exePath = @"C:\Documents and Settings\Bradley\My Documents\Visual Studio 2008\Projects\LogScrubber\LogScrubberService\bin\Debug\LogScrubberService.exe";



        Configuration configuration = ConfigurationManager.OpenExeConfiguration(exePath); 
       config = (LogScrubberConfiguration)configuration.GetSection("LogScrubber");

        BindingSource ScrubKeysBinder = new BindingSource(); 
        ScrubKeysBinder.DataSource = config.ScrubKeys;
        dgScrubKeys.AutoGenerateColumns = false; 
       dgScrubKeys.DataSource = ScrubKeysBinder; 
               

    }


  }
}
